<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      #btn {
        width: 100px;
        height: 100px;
        display: block;
        margin: 0 auto;
        font-size: 18px;
        color: brown;
        border-radius: 50%;
        cursor: pointer;
      }
      .index {
        width: 100%;
      }
      #box {
        width: 500px;
        height: 273px;
        float: right;
        display: none;
        margin-right: 30px;
        border: 2px solid yellowgreen;
        background-color: black;
        position: fixed;
        right: 0;
        bottom: 10px;
      }
      #turn_off {
        float: right;
        margin-top: 5px;
        margin-right: 5px;
        color: #fff;
        border: 1px solid #fff;
        cursor: pointer;
      }
      .index img {
        float: left;
        width: 100%;
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div class="index">
      <input type="button" value="开始倒计时" id="btn" />
      <div id="box">
        <div id="turn_off">X</div>
        <div><img src="../图片/传奇.png" /></div>
      </div>
      <input type="text" value="" id="lulu" />
      <input type="button" value="点击搜索" id="btn_go" />
    </div>
    <script>
      var count = 59;
      btn.onclick = function () {
        var t = setInterval(function () {
          btn.value = count;
          count--;
          if (count == 0) {
            clearInterval(t);
            btn.value = "倒计时结束";
          }
        }, 1000);
      };

      //广告框
      setTimeout(function () {
        box.style.display = "block";
      }, 2000);
      turn_off.onclick = function () {
        box.style.display = "none";
        setTimeout(function () {
          box.style.display = "block";
        }, 3000);
      };

      //页面跳转
      var baidu =
        "https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1&tn=baidu&wd=";
      btn_go.onclick = function () {
        if (lulu.value != undefined) {
          var go_url = baidu + lulu.value;
          location.href = go_url;
        }
      };
    </script>
  </body>
</html>
